using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using Samples.ShoppingCart;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        listBooks.ShoppingCart = shoppingCart;
        shoppingCart.ArticleAdd += new EventHandler(shoppingCart_ArticleAdd);

        if (!Page.IsPostBack)
        {
            List<Book> books = BusinessLayer.GetBooks();

            listBooks.DataSource = books;
            listBooks.DataBind();
        }
    }

    void shoppingCart_ArticleAdd(object sender, EventArgs e)
    {
        UpdatePanel2.Update();
    }
}